package com.bjsxt.springmvc.back.controller;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.bjsxt.commom.controller.BasicController;
import com.bjsxt.commom.util.ConstantFinalUtil;
import com.bjsxt.commom.util.PageInfoUtil;
import com.bjsxt.user.pojo.AAdmins;
import com.bjsxt.user.service.IUserService;

@Controller
public class AdminsController extends BasicController
{
	@Resource
	private IUserService userService;
	
	@RequestMapping("adminsLogin.htm")
	@SuppressWarnings("unchecked")
	public String adminsLogin()
	{
		/* 接受并处理参数 */
		Map<String, Object> map = this.getCondMap(request);
		/* 获得分页信息 */
		PageInfoUtil pageInfoUtil = (PageInfoUtil) map.get("pageInfoUtil");
		/* 获得查询参数  */
		Map<String,Object> condMap =  (Map<String, Object>) map.get("condMap");
		/* 获得原参数 */
		Map<String,Object> sourceMap = (Map<String, Object>) map.get("sourceMap");
		
		List<AAdmins> list = this.userService.findListAdminsService(pageInfoUtil, condMap);
		ConstantFinalUtil.LOGGER.info("-list的大小:{}--",list.size());
		ConstantFinalUtil.LOGGER.info("-分页信息:{}--",pageInfoUtil);
		ConstantFinalUtil.LOGGER.info("-原参数信息:{}--",sourceMap);
		ConstantFinalUtil.LOGGER.info("-处理参数信息:{}--",condMap);
		/* 放进作用域中 */
		request.setAttribute("list", list);
		request.setAttribute("map", sourceMap);
		return "/back/adminsLogin";
	}
}
